#pragma once

#include "photon.h"
#include "sceneDivCube.h"
#include "cccComboBreaker.h"

class photonMap
{
public:
	photonMap();
	~photonMap();

	double avarageSamplePower;
	double minPhotonPower;
	double maxPhotonPower;
	void addPhoton(photon Photon, unsigned int lightNr);
	void delPhoton(unsigned int nr);

	unsigned int getPhotonsFromSphere(point center, double *radius, color *intense, double *power, double maxRadius, unsigned int maxPhotons);

	void cleerPhotonMap();
	void declareLightsNumber(unsigned int n);
	unsigned int getLightsPhotonCount(unsigned int nr);
	unsigned int getPhotonCount();
	void scalePhotonPower(unsigned int lightNr, double factor);
	void countAvarageSamplePower(unsigned int photonCount);
	double getAvarageSamplePower();
	double getMinPhotonPower();
	double getMaxPhotonPower();

	//scene subdivison
	void subdivideScene(double cSize, point zeroPoint, point maxPoint);
	void createStructure();

private:
	std::vector<std::vector<photon*>*> map;
	std::vector<cccComboBreaker*> currentPhotons;
	std::vector<cccComboBreaker*> tempPhotons;

	std::vector<sceneDivCube*> divisionStructure;
	point zp;
	vector3 sceneSize;
	double cubeSize;

	int xDivs;
	int yDivs;
	int zDivs;
	int a;
	int b;
	int c;

};